]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell/screenshot: Plug memory leak
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 31 Aug 2022 10:51:54 +0000 (12:51 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 31 Aug 2022 13:25:43 +0000 (13:25 +0000)
grab_screenshot_content() does not follow the usual pattern of
```
  task = g_task_new (...);
  g_task_run_in_thread (task, ...);
  g_object_unref (task);
```

That means we hold the original reference throughout the operation,
and must release it ourselves when done.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5501

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2461>

src/shell-screenshot.c

index fcf2da2365e7437d5b51cb6c9d7f8cd51e22d331..f7132eee8e9fb2fab7bce5dcfefd51c1ad7dacba 100644 (file)
@@ -308,6 +308,7 @@ grab_screenshot_content (ShellScreenshot *screenshot,
   float scale;
   g_autoptr (GError) error = NULL;
   g_autoptr (ClutterContent) content = NULL;
+  g_autoptr (GTask) task = result;
   MetaCursorTracker *tracker;
   CoglTexture *cursor_texture;
   int cursor_hot_x, cursor_hot_y;